package com.sunny.ynhz.adapter.base;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.List;

/**
 * Created by huhuan123 on 2018/5/21.
 */

public class ViewPageFragmentAdapter extends FragmentPagerAdapter {
    List<Fragment> fragments;
    String title[];
    public ViewPageFragmentAdapter(FragmentManager fm, List<Fragment> fragments,String title[]) {
        super(fm);
        this.fragments = fragments;
        this.title=title;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
